package cn.rui.controller;

import cn.rui.aspects.Log;
import cn.rui.common.Result;
import cn.rui.pojo.vo.PageResult;
import cn.rui.service.LoginLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * 登录日志
 *
 * @author 徽州大都督
 * @date 2021/05/14
 */
@RequestMapping("log")
@RestController
public class LoginLogController {

    @Autowired
    private LoginLogService loginLogService;

    @PostMapping("findPage")
    //@Log("查询登录日志")
    public Map findPage(@RequestBody PageResult pageResult) {

        return loginLogService.findPage (pageResult);
    }


    @DeleteMapping("/deleteById/{id}")
    @Log("删除登录日志")
    public Result deleteById(@PathVariable("id") Integer id){
        return loginLogService.deleteById(id);
    }
}
